import request from '@/utils/request'

// 获取企业客户详情
export function fetchCustomerDetail(id) {
  return request({
    url: '/order/customer/detail',
    method: 'get',
    params: { cus_id: id }
  })
}

// 获取企业客户服务列表
export function fetchCustomerServiceList(id) {
  return request({
    url: '/order/customer/service/page',
    method: 'get',
    params: { cusId: id }
  })
}

// 获取企业客户分页列表
export function fetchCustomerList(query) {
  return request({
    url: '/order/customer/page',
    method: 'get',
    params: query
  })
}

// 获取下属企业分页列表
export function fetchBranchCustomerList(query) {
  return request({
    url: '/order/customer/branch/page',
    method: 'get',
    params: query
  })
}

// 客户购买记录分页
export function lineCustomerList(query) {
  return request({
    url: '/order/order/line/customer/page',
    method: 'get',
    params: query
  })
}

// 删除客户
export function deleteCustomer(params) {
  return request({
    url: '/order/customer/delete',
    method: 'delete',
    params
  })
}

// 批量删除客户
export function deleteCustomerBatch(data) {
  return request({
    url: '/order/customer/delete/batch',
    method: 'delete',
    data
  })
}

// 代账下属公司导入
export function importAgencyCompany(data) {
  return request({
    url: '/order/customer/dzgs/xs/import',
    method: 'post',
    data
  })
}

// 代账下属公司导入
export function importCloudTax(data) {
  return request({
    url: '/order/customer/cloud/tax/import',
    method: 'post',
    data
  })
}

// 修改分润状态
export function updateFrStatus(data) {
  return request({
    url: '/order/customer/fr/status',
    method: 'post',
    data
  })
}

export function importCustomerBranch(data) {
  return request({
    url: '/order/customer/import',
    method: 'post',
    data
  })
}

//获取企业客户分页列表
export function getCustomer(query) {
  return request({
    url: '/order/customer/page',
    method: 'get',
    params: query
  })
}

// 税号加密
export function encryptCode(params) {
  return request({
    url: '/customer/bizcustomer/encrypt',
    method: 'post',
    params
  })
}

// 税号加密
export function decryptCode(params) {
  return request({
    url: '/customer/bizcustomer/decode',
    method: 'post',
    params
  })
}

// 税号解密信息更新
export function upadteTaxpayer(data) {
  return request({
    url: '/customer/bizcustomer/upadteTaxpayer',
    method: 'post',
    data
  })
}
